#ifndef _MESSAGE_SYSTEM_H_
#define _MESSAGE_SYSTEM_H_

#include <vector>

enum EMessages
{
	MSG_PLAYER_DIED = 0,
	MSG_LEVEL_COMPLETE
};

struct TMessage
{
	int m_messageID;
};

class IMessageSystem
{
public:
	void post(TMessage*) = 0;
};

typedef void (IMessageSystem::*MessageCallbackFptr)(TMessage*);

class CMessageSystem
{
public:
	CMessageSystem();
	
	void registerMessageSystem(int, IMessageSystem*, MessageCallbackFptr);
	void unregisterMessageSystem(int, IMessageSystem*, MessageCallbackFptr);

private:
	std::vector<std::vector<std::pair<IMessageSystem*, MessageCallbackFptr> > > _listeners;
};

#endif // _MESSAGE_SYSTEM_H_